package com.mt.takeway.service.impl;

import com.mt.takeway.mapper.CustomerMapper;
import com.mt.takeway.po.Customer;
import com.mt.takeway.service.CustomerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/***
 *@title CustomerServiceImpl
 *@author chl
 *@create 2022/5/26 21:23
 */
@Service
public class CustomerServiceImpl implements CustomerService {

    @Resource
    private CustomerMapper customerMapper;

    @Override
    public Customer findCustomerByTel(String tel,String password) {
        Customer customer = customerMapper.customerLoginByTel(tel,password);
        return customer;
    }

    @Override
    public boolean registerCustomer(Customer customer) {
        int i = customerMapper.registerCustomer(customer);
        return i>0;
    }

    @Override
    public Customer findOneCustomer(String tel) {
        Customer customer = customerMapper.selectOneCustomer(tel);
        return customer;
    }
}
